#!/usr/bin/env python
# -*- encoding: utf-8 -*-
# Project: spd-sxmcc
"""
@file: gk_html_md.py
@author: lyndon
@time: Created on 2022-02-26 21:00
@env: Python
@desc:
@ref:
@blog:
"""

import os
import json
import html2text


def load(jsonfile):
    with open(jsonfile, mode='r', encoding='utf-8') as f:
        data = json.load(f)
        return data


if __name__ == '__main__':
    infile = r"D:\iProject\myPython\com\teradata\seleniumtest\gk\qm.json"
    data = load(infile)
    # print(data)
    # print(type(data))
    art = data["data"]["article_content"]

    outfile = r"D:\iProject\myPython\com\teradata\seleniumtest\gk\qm.md"
    with open(outfile, mode='a+', encoding='utf-8') as fo:
        fo.write(html2text.html2text(art))
